function vec_out = percentiles(vec_in, vec_perc)

N = size(vec_in, 1);
vec_select = ceil((N/100)*vec_perc');
sorted_vec_in = sort(vec_in,1);
vec_out = sorted_vec_in(vec_select);

%
